// mainAppDlg.h : header file
#if !defined(AFX_BETADLG_H__E9BE7578_37C3_4DA7_8221_98E3501141C9__INCLUDED_)
#define AFX_BETADLG_H__E9BE7578_37C3_4DA7_8221_98E3501141C9__INCLUDED_

//#include <afxrich.h>
//#include "afxtabctrl.h"
//
#include "mfcui\mfcui.h"

#define WM_LOG WM_USER+0x0100
#define WM_DRAW WM_USER+0x0101
#define CHART 2221

struct datdraw
{
	datdraw()
	{
	}
	datdraw(int moded,double xd,double yd)
	{
		mode=moded;
		x=xd;
		y=yd;
	}
	enum 
	{
		magx=0,
		magy
	};
	double x;
	double y;
	int mode;
};

class CBetaDlg : public CDialog
{
// Construction
public:
	//CSerialPort Port_mot,Port_loc;

	CBetaDlg(CWnd* pParent = NULL);	// standard constructor

	static DWORD WINAPI MagneticFunc(LPVOID Rp);
// Dialog Data
	//{{AFX_DATA(CBetaDlg)
	enum { IDD = IDD_BETA_DIALOG };
	CStatusBar Status;
	CChartCtrl 	chart;
	double Index_[100000];
	//CMFCMenuButton BackOptions;
	//}}AFX_DATA
public:

	void SafeMove(DWORD Id,int x,int y,int cx,int cy);
	CToolBar Tools;
	
	void OpenPort();

	CChartPointsSerie* pSeries1;
	CChartPointsSerie* pSeriesy1;//BUG,!GetSerie(0)

	void Drawx(double x,double y);
	void Drawy(double x,double y);	

	void InitChart();
	void setstatus();

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CBetaDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL


// Implementation
protected:
	HICON m_hIcon;
	// Generated message map functions
	//{{AFX_MSG(CBetaDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void onsetport();
	afx_msg void onexit();
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg void onsave();
	afx_msg void Settings();
	afx_msg void OnBegin();
	afx_msg void OnPause();
	afx_msg void OnStop();
	//afx_msg void OnSelchange(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void Tools_Msg(UINT id);//NMHDR* PNMHDR,LRESULT* pRESULT);
	void OnAppAbout();
	afx_msg void OnTestt();
	//}}AFX_MSG
	
	DECLARE_MESSAGE_MAP()
public:

	LRESULT onlog(WPARAM wParam, LPARAM lParam);
	LRESULT ondraw(WPARAM wParam, LPARAM lParam);

	virtual void OnOK();
	void setupChart(void);
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_BETADLG_H__E9BE7578_37C3_4DA7_8221_98E3501141C9__INCLUDED_)
